home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / src / Tools / freeWAIS-sf-1.1 / ir / field_index.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-05-15  |  3.6 KB  |  113 lines

  1. /* 
  2.  * field_index.h -- 
  3.  * SCCS Status     : %W%    %G%
  4.  * Author          : Huynh Quoc T. Tung
  5.  * Created On      : Fri Feb 18 10:23:09 1994
  6.  * Last Modified By: Huynh Quoc T. Tung
  7.  * Last Modified On: Mon May 16 14:35:45 1994
  8.  * Update Count    : 53
  9.  * Status          : Unknown, Use with caution!
  10.  */
  11.  
  12. #include "irfiles.h"
  13. #include "irtfiles.h"
  14.  
  15. #ifndef FIELD_INDEX_H
  16. #define FIELD_INDEX_H
  17.  
  18. #define I_GLOBAL 0
  19. #define I_LOCAL  1
  20. #define I_BOTH   2
  21.  
  22. #define NUMBER_OF_INDEXTYPES 3 /* TEXT, SOUNDEX, PHONIX.  
  23.                                   This is to change 
  24.                                   if new indextype will be implemented */
  25.  
  26. typedef struct index_fields_struct {
  27.   char** field_names;
  28.   boolean* numeric;
  29. } index_fields_struct;
  30.  
  31. typedef struct nidx_table {
  32.   long position;
  33.   long* begin_tag_pos;
  34.   long* end_tag_pos;
  35. } nidx_table;
  36.  
  37. typedef struct layout_struct {
  38.   long begin_tag_pos;
  39.   long end_tag_pos;
  40.   long hline_begin_tag_pos;
  41.   long len;
  42.   long offset;
  43. } layout_struct;
  44.   
  45.  
  46. typedef struct ltable {
  47.   long field_record_end_pos;
  48.   long date_tag_pos;
  49.   long date_begin_tag_pos;
  50.   char* date_desc;
  51.   char* sscanf_arg;
  52.   boolean month_is_string;
  53.   long number_of_headlines;
  54.   layout_struct* layout;
  55. } ltable;
  56.  
  57.  
  58. void save_nummeric_index_fields _AP((long field_id));
  59. long save_index_fields _AP((char* field_name, long* number_of_elements, long *field_id));
  60. char* match _AP((char* line, long* begin_pos, long* end_pos, long regexp_pos));
  61. long compile_regexp _AP((long number_of_regexp, char** regexp_set));
  62. long check_layout_for_line _AP((char* line));
  63. boolean init_index_fields _AP((boolean* adding_to_existing_index,
  64.                                boolean* create_new_fields,
  65.                                boolean field_adding_to_existing_index,
  66.                                long number_of_fields,
  67.                                database* db));     
  68. boolean open_field_streams_init _AP((boolean initialize,
  69.                                      boolean field_adding_to_existing_index,
  70.                                      long field_id,
  71.                                      database* db));
  72.  
  73. long count_words _AP((char* line, long* line_length, 
  74.                       boolean* newline_terminated));
  75.  
  76.  
  77. long how_index_line _AP((long field_id, char* line, 
  78.                          long* number_of_not_ended_section,
  79.                          long document_id,
  80.                          long weight,
  81.                          long file_position_before_line,
  82.                          long* line_length,
  83.                          boolean* newline_terminated,
  84.                          database* db,
  85.                          wordfunc *wordfunction1,
  86.                          wordfunc *wordfunction2,
  87.                          boolean word_position, 
  88.                          boolean word_pairs,
  89.                          int minwordlen, 
  90.                          char* type));
  91.  
  92. long index_line_section _AP((long field_id, long fpos,
  93.                              char* line,
  94.                              long document_id,
  95.                              long weight,
  96.                              long file_position_before_line,
  97.                              long* line_length,
  98.                              boolean* newline_terminated,
  99.                              database* db,
  100.                              wordfunc *wordfunction1,
  101.                              wordfunc *wordfunction2,
  102.                              boolean word_position, 
  103.                              boolean word_pairs,
  104.                              int minwordlen, 
  105.                              char* type));    
  106.  
  107. void clear_fields _AP((database* db));
  108.  
  109. void clear_Ftable_pos _AP((void));
  110.  
  111. boolean open_global_Database _AP((boolean initialize, database* db));
  112. #endif
  113.